package net.ddns.xcyyds.kungfu.procedures;

import net.minecraft.world.level.LevelAccessor;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.entity.Entity;
import net.minecraft.network.chat.TextComponent;

public class LProcedure {
	public static void execute(LevelAccessor world, double x, double y, double z, Entity entity) {
		if (entity == null)
			return;
		if (!((entity.getPersistentData().getString("NO3")).equals("R") || (entity.getPersistentData().getString("NO3")).equals("L"))
				&& entity.getPersistentData().getBoolean("kungFuUse") == true) {
			SoundProcedure.execute(world, x, y, z, 0.7f, 0.6f);
			ForSoundProcedure.execute(world, x, y, z);
			entity.getPersistentData().putString(("NO" + new java.text.DecimalFormat("##").format(entity.getPersistentData().getDouble("NO"))), "L");
			entity.getPersistentData().putDouble("NO", (entity.getPersistentData().getDouble("NO") + 1));
			if (entity instanceof Player _player && !_player.level.isClientSide())
				_player.displayClientMessage(new TextComponent(("-" + entity.getPersistentData().getString("NO1") + "-"
						+ entity.getPersistentData().getString("NO2") + "-" + entity.getPersistentData().getString("NO3") + "-")), (true));
		}
	}
}
